package com.woniuxy.staffservice.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.woniuxy.staffservice.entity.Dept;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface DeptMapper extends BaseMapper<Dept> {

    @Select("select d.* from sys_dept d where pid=#{pid}")
    List<Dept> getByPid(Integer pid);

    List<Dept> getByCondition(@Param("name") String name, @Param("address") String address
            , @Param("description") String description, @Param("index") Integer index, @Param("limit") Integer limit);

    @Select("select name from sys_dept where id=#{id}")
    String getNameById(Integer id);
}
